package com.yunshang.shoppingmall.mapper;

import com.yunshang.shoppingmall.entity.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CartMapper {
    int deleteByPrimaryKey(Integer shoppingId);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer shoppingId);
    Cart selectCart(@Param("productId") Integer productId, @Param("guigeId") Integer guigeId,@Param("userId") Integer userId);
    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    int updateLogByOrderNo(@Param("logisticalNo") String logisticalNo, @Param("orderList") List<String> orderList);
    int updateLogByOrderNoAndNumber(@Param("logisticalNo") String logisticalNo, @Param("orderList") List<String> orderList,@Param("productCount") String productCount);
    int updateLogType(@Param("logisticsType") Integer logisticsType, @Param("orderNo") String orderNo,@Param("addressId") Integer addressId);
    List<Cart> selectProductByIds(String ids);
    List<Cart> selectList(String orderNo);
    List<Cart> selectByOrderNo(String orderNo);
    int upCartStatus(@Param("ids") List<String> ids,@Param("orderNo") String orderNo);
    /*根据用户id 查询购物车的商品数量*/
   int selectCartProListByUserId(@Param("userId") int userId);
}